home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_asm
/
timings
/
timetest.asm
< prev
Wrap
Assembly Source File
|
1986-01-17
|
1KB
|
69 lines
title TIMETEST -- Simple execution time test routine.
page 60,120
name TIMETEST
comment |
TIMETEST -- Simple execution time test routine.
Copyright: None.
This routine spins in a loop for a while to provide a comparison of actual
versus calculated execution time.
Environment: DOS 1.1 or 2.0, segment name CODE, byte aligned.
Calling requirements: COM routine.
Effects and results: Some processor time burned up.
Return conditions: None.
Assumptions: None.
Limitations: None.
Build requirements: COM routine.
Program derived from: None.
Original code by: Tom Puckett, October 1983.
Modifications by: None.
|
page
code segment public byte
assume cs:code
org 100h ; PSP space
public TIMETEST
TIMETEST proc near
xor cx,cx ; 65536 times
mov dx,50
loop:
rol ax,1 ; 2 clocks, two bytes, should drain
rol ax,1 ; 2 the prefetch queue....
rol ax,1 ; 2
rol ax,1 ; 2
rol ax,1 ; 2
rol ax,1 ; 2
loop loop ; 17
; = 29 clocks, 6.09 microseconds
dec dx ; times 65536 gives .399 seconds
jnz loop ; times 50 gives 20 seconds
ret ; measured time is about 50 seconds!
TIMETEST endp
code ends ; end code segment
end TIMETEST ; end module